package com.starlink.model.util;

import com.starlink.model.dtomapper.MallIntegrationOrderDetailsDtoMapper;
import com.starlink.model.domain.MallIntegrationOrderDetailsDO;
import com.starlink.model.vo.MallIntegrationOrderDetailsVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class MallIntegrationOrderDetailsConvert {

    public static List<MallIntegrationOrderDetailsVO> buildMallIntegrationOrderDetailsVoList(List<MallIntegrationOrderDetailsDO> mallIntegrationOrderDetailsDOList) {
        if (CollectionUtils.isEmpty(mallIntegrationOrderDetailsDOList)) {
            return Lists.newArrayList();
        }
        List<MallIntegrationOrderDetailsVO> mallIntegrationOrderDetailsVOList = new ArrayList<>();
        for (MallIntegrationOrderDetailsDO mallIntegrationOrderDetailsDO : mallIntegrationOrderDetailsDOList) {
            mallIntegrationOrderDetailsVOList.add(MallIntegrationOrderDetailsDtoMapper.INSTANCE.do2VO(mallIntegrationOrderDetailsDO));
        }

        return mallIntegrationOrderDetailsVOList;
    }
}
